package com.wkb.design.createModing.abstratorFactory;

import com.wkb.design.createModing.abstratorFactory.itf.IKfactory;
import com.wkb.design.createModing.abstratorFactory.model.ChickWings;
import com.wkb.design.createModing.abstratorFactory.model.FrenchFries;
import com.wkb.design.createModing.abstratorFactory.model.Hamburger;

/**  
 * @author wkb 
 * @version 创建时间：2013-6-13 下午2:57:02  
 * 类说明
 */
public class Custon {

	private IKfactory factory ;

	public Custon(IKfactory factory) {
		
		this.factory = factory;
	}
	
	/**
	 * 预定汉堡
	 * @param num
	 * @return
	 */
	public float orderHamburg(int num){
		
		Hamburger humburger = factory.createHamburger(null, num);
		humburger.printMessage();
		return humburger.totleMoney();
	}
	
	/**
	 * 预定可乐
	 * @param num
	 * @return
	 */
	public float orderFrenchFries(int num){
		
		FrenchFries frenchFries = factory.createFrenchFries(num);
		frenchFries.printMessage();
		return frenchFries.totleMoney();
	}

	/**
	 * 预定鸡翅
	 * @param num
	 * @return
	 */
	public float orderChickWings(int num){
	
		ChickWings chickWings = factory.createChickWings(num);
		chickWings.printMessage();
		return chickWings.totleMoney();
	}
	
}
